<script setup lang='ts'>
import { PureTableBar } from "@/components/RePureTableBar";
import { useEcommercePlatform } from "./hooks/EcommercePlatform";
const {
  rules,
  columns,
  loading,
  dataList,
  pagination,
  handleSizeChange,
  handleCurrentChange,
  DialogVisible,
  EntryPlatform,
  RefEntryPlatform,
  UnlockFirm,
  CloseEntryPlatform,
  SubtimEntryPlatform,
  deleteSupple,
} = useEcommercePlatform()
</script>
    <!-- 入住电商平台 -->
<template>
  <div class="main">
    <PureTableBar title="入驻平台企业列表" class="list_hei">
      <template #buttons>
        <el-button type="primary" @click="DialogVisible = true">入驻平台 </el-button>
      </template>
      <template v-slot="{ size, checkList }">
        <pure-table border align-whole="center" showOverflowTooltip table-layout="auto" adaptive :loading="loading"
          size="small" :data="dataList" max-height="600" :columns="columns" :checkList="checkList"
          :pagination="pagination" @size-change="handleSizeChange" @current-change="handleCurrentChange"
          :header-cell-style="{
            background: 'var(--el-table-row-hover-bg-color)',
            color: 'var(--el-text-color-primary)'
          }">
          <template #operation="{ row }">
            <el-button type='primary' size="small" text @click="UnlockFirm(row)" v-if="!row.isActive">
              锁定
              <!-- 激活 -->
            </el-button>
            <el-button class="reset-margin" text size="small" type="danger" @click="deleteSupple(row)">删除</el-button>
          </template>
        </pure-table>
      </template>
    </PureTableBar>
  </div>
  <!-- 入驻平台窗口 -->
  <ReDialog :width="1000" :height="500" :models="DialogVisible" @Closes="CloseEntryPlatform(RefEntryPlatform)">
    <template #header>
      <h2 style="text-align: center;">入驻电商平台窗口</h2>
    </template>
    <template #main>
      <el-scrollbar height="430px">
        <el-form label-width="180px" ref="RefEntryPlatform" :rules="rules" :model="EntryPlatform" :inline="true">
          <el-form-item label="供应商企业名称" prop="name">
            <el-input v-model="EntryPlatform.name" />
          </el-form-item>
          <el-form-item label="总资产(元)" prop="TotalAssets">
            <el-input v-model.number="EntryPlatform.TotalAssets" type="number" />
          </el-form-item>
          <el-form-item label="总负债(元)" prop="TotalLiabilities">
            <el-input v-model.number="EntryPlatform.TotalLiabilities" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="资产负债率(%)">
            <el-input v-model.number="EntryPlatform.AssetliabilityRatio" type="number" disabled />
          </el-form-item>
          <el-form-item label="净利润(元)" prop="NetProfit">
            <el-input v-model.number="EntryPlatform.NetProfit" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="营业总收入(元)" prop="GrossPperatingIncome">
            <el-input v-model.number="EntryPlatform.GrossPperatingIncome" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="营业利润(元)" prop="OperatingProfit">
            <el-input v-model.number="EntryPlatform.OperatingProfit" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="利润总额(元)" prop="GrossProfit">
            <el-input v-model.number="EntryPlatform.GrossProfit" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="净现金流(元)" prop="NetCashFlow">
            <el-input v-model.number="EntryPlatform.NetCashFlow" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="经营性净现金流占比(%)" prop="PONOCashFlow">
            <el-input v-model.number="EntryPlatform.PONOCashFlow" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="经营性现金流量净额(元)" prop="NOCashFlow">
            <el-input v-model.number="EntryPlatform.NOCashFlow" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="净资产收益率(%) " prop="ReturnEquity">
            <el-input v-model.number="EntryPlatform.ReturnEquity" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="营业总支出(元)" prop="GrossOperatingExpenditure">
            <el-input v-model.number="EntryPlatform.GrossOperatingExpenditure" type="number"
              onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="货币资金(亿元)" prop="Monetaryfunds">
            <el-input v-model.number="EntryPlatform.Monetaryfunds" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="应收账款(元)" prop="AccountsReceivable">
            <el-input v-model.number="EntryPlatform.AccountsReceivable" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="应付账款(元)" prop="AccountsPayable">
            <el-input v-model.number="EntryPlatform.AccountsPayable" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="预收账款(元)" prop="AccountsReceivedAdvance">
            <el-input v-model.number="EntryPlatform.AccountsReceivedAdvance" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="净利润同比(%)" prop="NetprofitYearOYear">
            <el-input v-model="EntryPlatform.NetprofitYearOYear" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="营业总收入同比(%)" prop="TotalOperatingIYOY">
            <el-input v-model.number="EntryPlatform.TotalOperatingIYOY" type="number" onmousewheel="return false;" />
          </el-form-item>
          <el-form-item label="净现金流同比增长(%)" prop="NetCashFlowIYOY">
            <el-input v-model.number="EntryPlatform.NetCashFlowIYOY" type="number" onmousewheel="return false;" />
          </el-form-item>
        </el-form>
      </el-scrollbar>
    </template>
    <template #footer>
      <span class="dialog-footer">
        <el-button type="primary" @click="SubtimEntryPlatform(RefEntryPlatform)"> 确定 </el-button>
        <el-button @click="CloseEntryPlatform(RefEntryPlatform)"> 取消 </el-button>
      </span>
    </template>
  </ReDialog>
</template>

<style scoped lang="scss">
@import url(@/style/CreditComm.scss);

:deep(.el-dialog__footer) {
  text-align: center;
}
</style>
